let (|>) x f =
	f x

let do_finally_p2 f post_f p =
  let res = try `Result(f(p)) with e -> `Exn(e) in
		post_f p |> ignore;
		match res with
			| `Result(r) -> r
			| `Exn(e) -> raise e
		
let do_finally_p  = fun f post_f p -> do_finally_p2 (fun _ -> f p) post_f () 

let do_finally = fun f post_f -> do_finally_p2 f post_f () 


